from ckeditor.widgets import CKEditorWidget
from django import forms
from bbs.models import Bbs, Comment
from user.models import User


class BbsForm(forms.Form):
    content = forms.CharField(widget=CKEditorWidget())


class CommentForm(forms.Form):
    content = forms.CharField(widget=CKEditorWidget())


class CreateBbs(forms.ModelForm):
    class Meta:
        model = Bbs
        user = forms.ModelMultipleChoiceField(queryset=User.objects.all())
        fields = ('title', 'content', 'type', 'user', 'anonymous')


class CreateComment(forms.ModelForm):
    class Meta:
        model = Comment
        user = forms.ModelMultipleChoiceField(queryset=User.objects.all())
        bbs = forms.ModelMultipleChoiceField(queryset=Bbs.objects.all())
        fields = ('content', 'user', 'bbs')
